<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName" value="${message(code: 'menu.label', default: 'Menu')}"/>

    <title>区域：${this?.territory.name}</title>
</head>

<body>

<div class="main-body">
    <div class="page-wrapper">
        <!-- Page-header start -->
        <div class="page-header">
            <div class="page-header-title">
                <h4>区域：${this.menu?.name}</h4>
            </div>

            <div class="page-header-breadcrumb">
                <ul class="breadcrumb-title">
                    <li class="breadcrumb-item">
                        <a href="/salesDashboard/index">
                            <i class="icofont icofont-home"></i>
                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <g:link action="index" controller="territory">territory列表</g:link>
                    </li>
                    <li class="breadcrumb-item"><a href="#!">区域：${this?.territory.name}</a>
                    </li>
                </ul>
            </div>
        </div>
        <!-- Page-header end -->
        <!-- Page-body start -->
        <div class="page-body">

            <!-- Hover table card start -->
            <div class="card">
                <div class="card-header">
                    <h5>区域：${this?.territory.name}</h5>

                    <div class="card-header-right">
                        <g:link action="edit" resource="${this.territory}" data-toggle="tooltip" data-placement="top"
                                title="" data-original-title="编辑">
                            <i class="icofont icofont-edit"></i>
                        </g:link>

                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>

                <div class="card-block">
                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">名称</label>

                        <div class="col-md-3">
                            <span class="cont">${this.territory?.name}</span>
                        </div>
                        <label class="col-md-2 col-form-label">公司</label>

                        <div class="col-md-3">
                            <span class="cont">
                                ${this.territory?.account}
                            </span>
                        </div>

                    </div>
                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">产品</label>

                        <div class="col-md-3">
                            <span class="cont">
                                ${this.territory?.product}
                            </span>
                        </div>
                        <label class="col-md-2 col-form-label">工作流</label>

                        <div class="col-md-3">
                            <span class="cont">
                                ${this.territory?.workflow?.name}
                            </span>
                        </div>

                    </div>
                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">启用</label>

                        <div class="col-md-3">
                            <span class="cont">
                                ${this.territory?.active}
                            </span>
                        </div>
                        <label class="col-md-2 col-form-label">外部ID</label>

                        <div class="col-md-3">
                            <span class="cont">
                                ${this.territory?.externalId}
                            </span>
                        </div>

                    </div>


                    <div class="form-group row">
                        <label class="col-md-2 col-form-label">创建时间</label>

                        <div class="col-md-3">
                            <span class="cont">
                                <g:formatDate date="${this?.territory?.createdDate}"
                                              format="yyyy-MM-dd HH:mm:ss"></g:formatDate>
                            </span>
                        </div>
                        <label class="col-md-2 col-form-label">修改时间</label>

                        <div class="col-md-3">
                            <span class="cont">
                                <g:formatDate date="${this?.territory?.modifiedDate}"
                                              format="yyyy-MM-dd HH:mm:ss"></g:formatDate>
                            </span>
                        </div>
                    </div>

                </div>

            </div>

            <div class="card">
                <div class="card-header">
                    <h5>团队</h5>

                    <div class="card-header-right">


                        <g:link action="create" controller="territoryTeam" params="[territory: this.territory.id]"
                                data-toggle="tooltip"
                                data-placement="top" title=""
                                data-original-title="新增"><i class="icofont icofont-plus"></i></g:link>


                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>

                <div class="card-block dt-responsive">

                    <div class="table-responsive">
                        <div id="dom-jqry_wrapper" class="dataTables_wrapper dt-bootstrap4">
                            <div class="table-responsive">
                                <table class="table table-striped table-hover table-bordered">
                                    <thead>
                                    <tr>
                                        <g:sortableColumn property="fullName" title="姓名"/>
                                        <g:sortableColumn property="role" title="角色"/>
                                        <g:sortableColumn property="createBy" title="创建人"/>
                                        <g:sortableColumn property="modifyBy" title="修改人"/>
                                        <g:sortableColumn property="startTime" title="开始时间"></g:sortableColumn>
                                        <g:sortableColumn property="endTime" title="结束时间"></g:sortableColumn>
                                        <g:sortableColumn property="createdDate" title="创建时间"></g:sortableColumn>
                                        <g:sortableColumn property="modifiedDate" title="修改时间"></g:sortableColumn>
                                        <g:sortableColumn property="active"  width="10%" class="text-center"  title="操作"/>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <g:each in="${this.territoryTeams}">
                                        <tr>
                                            <td>${it?.user?.fullName}</td>
                                            <td>${it?.teamRole?.name}</td>
                                            <td>${it?.createBy}</td>
                                            <td>${it?.modifyBy}</td>
                                            <td><g:formatDate date="${it?.startTime}"
                                                              format="yyyy-MM-dd HH:mm:ss"></g:formatDate></td>
                                            <td><g:formatDate date="${it?.endTime}"
                                                              format="yyyy-MM-dd HH:mm:ss"></g:formatDate></td>
                                            <td><g:formatDate date="${it?.createdDate}"
                                                              format="yyyy-MM-dd HH:mm:ss"></g:formatDate></td>
                                            <td><g:formatDate date="${it?.modifiedDate}"
                                                              format="yyyy-MM-dd HH:mm:ss"></g:formatDate></td>
                                            <td class="text-center">
                                                <g:link class="m-r-15 text-primary"
                                                        controller="territoryTeam" action="edit"
                                                        id="${it?.id}">
                                                    <i class="icofont icofont-ui-edit"></i>
                                                </g:link>

                                                <g:form controller="territoryTeam" action="delete" class="inline"
                                                        id="${it.id}" method="DELETE">
                                                    <button class="deleteBtn text-danger" type="button">
                                                        <i class="icofont icofont-trash"></i>
                                                    </button>
                                                </g:form>

                                            </td>


                                        </tr>
                                    </g:each>
                                    </tbody>
                                </table>

                            </div>
                        </div>
                    </div>
                </div>

            </div>
            <!-- Hover table card end -->
        </div>

        <!-- Page-body end -->

    </div>
</div>

</body>

</html>


